package pagefetch.model;

import java.net.URL;

public class HandledLinkObject {
	
	private URL oldLink;
	private String newLink;
	
	public HandledLinkObject(URL oldUrl, String newLink){
		this.oldLink = oldUrl;
		this.newLink = newLink;
	}
	/**
	 * 
	 * @param link link to check
	 * @return true if the given link is the same as the old link-url given to this object
	 */
	public boolean sameAs(URL link){
		return link.equals(oldLink);
	}

	/**
	 * @return the oldLink
	 */
	public URL getOldLink() {
		return oldLink;
	}

	/**
	 * @param oldLink the oldLink to set
	 */
	public void setOldLink(URL oldLink) {
		this.oldLink = oldLink;
	}

	/**
	 * @return the newLink
	 */
	public String getNewLink() {
		return newLink;
	}

	/**
	 * @param newLink the newLink to set
	 */
	public void setNewLink(String newLink) {
		this.newLink = newLink;
	}
}
